package com.gitee.neuray.security.admin.log.rpc;

import com.gitee.neuray.security.admin.api.AdminLogServiceApi;
import com.gitee.neuray.security.admin.log.LogInfo;
import com.gitee.neuray.security.admin.log.biz.AdminGatelogBiz;
import com.gitee.neuray.security.admin.log.entity.AdminGatelogEntity;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogRest implements AdminLogServiceApi {
    @Autowired
    private AdminGatelogBiz gateLogBiz;
    @Override
    public @ResponseBody void saveLog(@RequestBody LogInfo info){
        AdminGatelogEntity log = new AdminGatelogEntity();
        BeanUtils.copyProperties(info,log);
        gateLogBiz.insertSelective(log);
    }
}
